package site

import "gitee.com/wcs2/common/enums"

type SiteInfoEnum string

const (
	/*站点类型枚举*/
	STORAGE              = "STORAGE"
	HOISTER_OUT_WAITING  = "HOISTER_OUT_WAITING"
	HOISTER_IN_WAITING   = "HOISTER_IN_WAITING"
	HOISTER_WAITING      = "HOISTER_WAITING"
	HOISTER_SITE         = "HOISTER_SITE"
	AGV_WAITING          = "AGV_WAITING"
	PICKING              = "PICKING"
	IN_SCANER            = "IN_SCANER"
	CONVEYOR_IN_WAITING  = "CONVEYOR_IN_WAITING"
	CONVEYOR_OUT_WAITING = "CONVEYOR_OUT_WAITING"
	CONVEYOR_WAITING     = "CONVEYOR_WAITING"
	CONVEYOR_LINE        = "CONVEYOR_LINE"
	TRANSFER_STAGING     = "TRANSFER_STAGING"
	PALLETIZING          = "PALLETIZING"
	DESTACKING           = "DESTACKING"

	/*库位状态枚举*/
	IDLE             = "IDLE"
	LOCKED           = "LOCKED"
	OCC              = "OCC"
	TEMP_OCC         = "TEMP_OCC"
	ARRIVE           = "ARRIVE"
	WAITING_SHIPMENT = "WAITING_SHIPMENT"
	FULL             = "FULL"

	/*位置区域枚举*/
	FPA_BS    = "FPA_BS"
	FPA_OP1   = "FPA_OP1"
	FPA_OP2   = "FPA_OP2"
	FPA_LABEL = "FPA_LABEL"
	STACK_CB  = "STACK_CB"
	STACK_BA  = "STACK_BA"
	STACK_TC1 = "STACK_TC1"
	STACK_TC2 = "STACK_TC2"
	MANUAL_WP = "MANUAL_WP"
	RGV       = "RGV"

	/*肥波区域枚举*/
	FB_NF   = "FB_NF"
	FB_FPA  = "FB_FPA"
	FB_ROAD = "FB_ROAD"
)

var siteTypeMap = map[enums.WCSEnum]string{
	/*站点类型枚举*/
	STORAGE:              "存储位",
	HOISTER_OUT_WAITING:  "提升机出口等待位",
	HOISTER_IN_WAITING:   "提升机入口等待位",
	HOISTER_WAITING:      "提升机等待位",
	HOISTER_SITE:         "提升机位",
	AGV_WAITING:          "AGV等待位",
	PICKING:              "拣选位",
	IN_SCANER:            "入库扫描口",
	CONVEYOR_IN_WAITING:  "输送线入库等待位(1楼无提升机)",
	CONVEYOR_OUT_WAITING: "输送线出库等待位(1楼无提升机)",
	CONVEYOR_WAITING:     "输送线等待位",
	CONVEYOR_LINE:        "输送线工位",
	TRANSFER_STAGING:     "移位周转暂存位",
	PALLETIZING:          "码垛位",
	DESTACKING:           "拆垛位",

	/*库位状态枚举*/
	IDLE:             "空闲",
	LOCKED:           "锁定（有任务安排）",
	OCC:              "占用中",
	TEMP_OCC:         "临时占用（AGV临时占用）",
	ARRIVE:           "容器到位",
	WAITING_SHIPMENT: "等待出库任务",
	FULL:             "满托",

	/*位置区域枚举*/
	FPA_BS:    "成品区-缓冲位",
	FPA_OP1:   "成品区-1号操作位",
	FPA_OP2:   "成品区-2号操作位",
	FPA_LABEL: "成品区-自动贴标位",
	STACK_CB:  "码垛区-笼箱位",
	STACK_BA:  "码垛区-缓冲位",
	STACK_TC1: "码垛区-顶盖垛待命位",
	STACK_TC2: "码垛区-顶盖垛抓盖位",
	MANUAL_WP: "人工模式作业区-工作位",
	RGV:       "穿梭车库区",

	/*肥波区域枚举*/
	FB_NF:   "肥波-农夫（码垛区）",
	FB_FPA:  "肥波-成品区",
	FB_ROAD: "肥波-道路区域",
}

//	获取相应描述，示例
//	siteType := SiteInfoEnum(STORAGE)
//	siteType.Value()
func (siteInfoEnum *SiteInfoEnum) Value(code enums.WCSEnum) string {
	if msg, ok := siteTypeMap[code]; ok {
		return msg
	}
	return "未知类型"
}

func test() {
	siteType := SiteInfoEnum(STORAGE)
	siteType.Value(STORAGE)
}
